/*********************************************************************
*
* File: mario.h
* Create Mario
* Author: 10520418 Bui Huu Hiep
*
**********************************************************************/
#ifndef _MARIO_H
#define _MARIO_H

#include "GameObject.h"

#define MARIO_VX_MAX 300
#define MARIO_VY_MAX 1000
#define MARIO_VY_MEDIUM 200

/********************************************
*
* Mario
* Inheritance form class Obj
* Create Mario
*
********************************************/
class Mario : public GameObject
{
private:
	Sprite*			_spriteSmall;
	Sprite*			_spriteBig;
	Sprite*			_spriteFire;

	int				_sprite_index;			// 1 = _spriteBig || 2 =_spriteSmall || 3 =_spriteFire

	bool			_isWin;
	bool			_isChangeMap;

public:
	float			_vel_x_max;

	bool			_is_jumping;	// Mario is jumping
	bool			_is_sit;
	bool			_imperishable;
	int				_count_time;
public:
	Mario(float posX, float posY, float width, float height, int kind, Resources* res, int number, int depth);
	~Mario(void);

	void ProcessInput(Input* input);
	void Update(float time, QNode* &Tree);
	void Render(LPD3DXSPRITE spriteHandler, Viewport* viewport);

	bool GetIsWin() { return _isWin; }

	void SetIsWin(bool val) { _isWin = val; }
	void SetIsChangeMap(bool val) { _isChangeMap = val; }
	void SetAy(int val) { _acc_y = val; }
	bool Imperishable(){ return _imperishable; }
private:
	void Move(float time, vector<GameObject*> &listObj);
	void UpdateAnimation(float time);
	void Flashing();
	void ChangeState(char state);
};
#endif
